'use strict';
// Copyright 2014 Blueant Inc. All Rights Reserved.

/**
 * @fileoverview 军团
 * @author sundbcn@gmail.com (sun debing)
 */

var _ = require('lodash');
var async = require('async');
var moment = require('moment');
var unionGroupModel = require('../models/unionGroupModel');
var roleModel = require('../models/roleModel');
var onlineService = require('./onlineService');
var PlayerManager = require('../libs/playerManager');
var unionGroupConf = require('../config/unionGroupConf');

/**
 * 获取军团列表
 */
exports.getUnionGroupList = function (callback) {
    var union_group_list = [];
    async.waterfall(
        [
            function (cb) {
                unionGroupModel.getUnionList(cb);
            },
            function (union_list, cb) {
                union_group_list = union_list;
                cb();
            }
        ],
        function (err) {
            if (!!err) {
                console.error(err);
                return callback();
            }
            callback(null, union_group_list);
        }
    );
};
